<?php
C_base::yn_file('m'.DS.'Model.php');
class newsModel extends model{
/*****************新闻表操作*******************/
	function news_ss($w){//查询新闻 多条
		return $this->news()->w($w)->ss();
	}
	
	function news_ssp($w,$page='',$pagesize='',$name,$sx){
		$r['data'] = $this->news()->w($w)->p($page,$pagesize)->o($name,$sx)->ss();
		$r['count'] = $this->news()->w($w)->n();
		return $r;
	}
	
	function news_s($w){//查询新闻单条
		return $this->news()->w($w)->o('id')->s();
	}
	
	function news_c($w){//新闻写入
		return $this->news()->c($w);
	}
	
	function news_u($w,$u){//修改新闻
		return $this->news()->w($w)->u($u);
	}
	
	function news_d($w){//新闻删除
		return $this->news()->w($w)->d();
	}
	
	//上一篇/下一篇新闻 
	function title_s($w,$o=''){
		if($o){
			return $this->news()->w($w)->o('id')->s();
		}else{
			return $this->news()->w($w)->s();
		}
	}
/*******************************数据库************************************/
	function news(){//新闻表
		return $this->db_kf()->news;
	}
}
?>